Skip to content

Conversation

@SasakiTakatsugu
Copy link
Contributor

・ユーザー一覧へプラン設定へのリンク追加

image

・プラン設定画面を追加

image

@SasakiTakatsugu
Copy link
Contributor Author

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a plan settings feature that allows users to manage tenant pricing plans. The changes include adding a navigation link to plan settings from user pages and implementing a comprehensive plan settings page with support for plan changes, cancellations, and reservations.

  • Adds "プラン設定" (Plan Settings) link to UserPage
  • Implements a new PlanSettings page with plan management functionality
  • Refactors utility functions to be more generic and reusable

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils.ts Refactored handleUserListClick to navigateToUserPageByRole with improved error handling and generic parameters
src/types/index.ts Added PlanReservation interface and updated Tenant interface with plan reservation fields
src/types/billing.ts Updated TaxRate interface and added PlanInfo, PricingPlan, PricingMenu, and PricingUnit interfaces
src/pages/UserPage.tsx Added link to plan settings page
src/pages/TenantList.tsx Updated to use refactored navigation function
src/pages/PlanSettings.tsx New comprehensive plan settings page with full CRUD functionality
src/pages/BillingDashboard.tsx Updated imports and function calls to use refactored navigation
src/App.tsx Added route for the new plan settings page

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

</select>
</div>

{/* 反映び */}
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「反映び」は誤字です。「反映日」に修正してください。

Suggested change
{/* 反映び */}
{/* 反映日 */}

Copilot uses AI. Check for mistakes.

// カスタム日時が指定されている場合のみ using_next_plan_from を設定
if (usingNextPlanFrom === "custom" && customDate) {
updateData.using_next_plan_from = Math.floor(new Date(customDate).getTime() / 1000);
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

customDateが空文字列の場合、new Date('')は無効な日付となりNaNが返されます。customDateの妥当性チェックを追加してください。

Suggested change
updateData.using_next_plan_from = Math.floor(new Date(customDate).getTime() / 1000);
const date = new Date(customDate);
if (!isNaN(date.getTime())) {
updateData.using_next_plan_from = Math.floor(date.getTime() / 1000);
}

Copilot uses AI. Check for mistakes.
Comment on lines 187 to 189
const showError = (message: string) => {
alert(message); // 後でトーストやモーダルに置き換え可能
};
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] alert()の使用はユーザーエクスペリエンスが良くありません。既存のモーダルパターンやトーストライブラリを使用することを検討してください。

Copilot uses AI. Check for mistakes.
Comment on lines 637 to 639
setDateValidationError(`5分後の日時より前は選択できません。${minDateString}に設定しました。`);
// 3秒後にエラーメッセージを消す
setTimeout(() => setDateValidationError(""), 3000);
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeoutのクリーンアップが実装されていません。コンポーネントがアンマウントされた際にタイマーをクリアするか、useEffectでクリーンアップ関数を設定してください。

Copilot uses AI. Check for mistakes.
Comment on lines +405 to +412
await axios.put(
`${API_ENDPOINT}/tenants/${tenantId}/plan`,
{},
{
headers: getActionHeaders("reservation_cancel"),
withCredentials: true,
}
);
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] 空のリクエストボディ{}で予約取り消しを行うのは直感的ではありません。より明示的なAPI設計(DELETEメソッドやcancel: trueフラグなど)を検討してください。

Copilot uses AI. Check for mistakes.
@SasakiTakatsugu
Copy link
Contributor Author

同機能修正
バックエンド java
saasus-platform/implementation-sample-api-java#11

@KooriyamaHiroki KooriyamaHiroki merged commit 688d13a into main Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants